package com.example.product.aspect;

import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class AuthAspect {

    @Pointcut("execution(* com.example.product.proxy.Calc.*(..))")
    public void pointCut() {

    }

    @Before("pointCut()")
    public void before() {
        System.out.println("auth before");
    }

    @After("execution(* com.example.product.proxy.Calc.*(..))")
    public void after() {
        System.out.println("auth after");
    }

    @AfterReturning("pointCut()")
    public void afterReturning() {
        System.out.println("auth afterReturning");
    }

    @AfterThrowing("pointCut()")
    public void afterThrowing() {
        System.out.println("auth afterThrowing");
    }

}
